/*
 * Bsp.c
 *
 *  Created on: Mar 25, 2025
 *      Author: Administrator
 */

#include "Bsp.h"




void Bsp_Init (void){

	Beep_On_Time(100);

	OLED_Init();
	Motor_Init();
	Encoder_Init();
	PID_Param_Init();
	USART1_Init();

	uint8_t res = MPU9250_Init();
		if (res != 0)
		{
			printf("MPU9250 INIT ERROR\n");
			while(1);
		}
	OLED_ShowString(1, 1, "Vx=");
	OLED_ShowString(2, 1, "Vy=");
	OLED_ShowString(3, 1, "Vz=");
	OLED_ShowString(1, 9, "mm/s");
	OLED_ShowString(2, 9, "mm/s");
	OLED_ShowString(3, 9, "mm/s");
}




//led运行状态显示
void Bsp_Led_Show_State_Handle(void){

	static uint8_t led_count = 0;
	led_count++;
	if(led_count > 99){
		LED_TOGGLE();
	}
}
